Skip to content

fix(rpc): handle properly action form#309

Open
arnaud-moncel wants to merge 2 commits into
mainfrom
fix/rpc/action-form
Open

fix(rpc): handle properly action form#309
arnaud-moncel wants to merge 2 commits into
mainfrom
fix/rpc/action-form

Conversation

@arnaud-moncel
Copy link
Copy Markdown
Member

@arnaud-moncel arnaud-moncel commented May 21, 2026

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

Note

Fix RPC schema to include static_form in serialized actions

  • Adds static_form to the RPC wire schema by including it in serialize_actions, alongside scope, is_generate_file, description, and submit_button_label; form and execute are explicitly excluded.
  • Updates BaseAction.initialize to accept a static_form parameter (default: false) and passes it through from from_plain_object, so the value from the schema is preserved on the instance.
  • Refactors build_rpc_schema_from_datasource in agent.rb into smaller helpers (extract_rpc_collection_relations, build_normal_collection_payload, serialize_actions) to cleanly separate schema-building concerns.

Macroscope summarized aedfadb.

@qltysh
Copy link
Copy Markdown

qltysh Bot commented May 21, 2026

2 new issues

Tool Category Rule Count
qlty Structure Function with many parameters (count = 7): initialize 1
qlty Structure Function with high complexity (count = 6): extract_rpc_collection_relations 1


def initialize(scope:, form: nil, is_generate_file: false, description: nil, submit_button_label: nil, &execute)
# rubocop:disable Metrics/ParameterLists
def initialize(scope:, form: nil, is_generate_file: false, description: nil,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 7): initialize [qlty:function-parameters]

next if relation_targets_rpc_collection?(field)

relations[field_name] = field
end
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 6): extract_rpc_collection_relations [qlty:function-complexity]

is_generate_file: action[:is_generate_file],
description: action[:description],
submit_button_label: action[:submit_button_label],
static_form: action[:static_form],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT action[:static_form] || false to avoid @static_form = nil when the key is missing ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants